Python variable won't update outside of module